Avorion Script API Documentation

Galaxy [Client]

This object is only available on the client.

function Galaxy()

Returns

A new instance of Galaxy

function bool factionExists(int index)

function UserObject findFaction(int omdex)

Looks for a faction with the given index. This function returns the correct concrete type of the faction, ie. Faction, Player or Alliance. Note: With this client function, it can only return the local player or their alliance.

Parameters

omdex An int, index of the faction

Returns

The faction if found, or nil

function var getControllingFaction(int x, int y)

Does a lookup on the faction map and retrieves the faction CURRENTLY controlling the sector. The faction is determined by the influence of sectors around the sector to check. As sectors are generated while players are exploring, influence over sectors is also only generated while players are exploring. It's very possible that as long as not all sectors near the tested sector have been discovered, the influence is not yet determined nor final. Keep in mind that if the player hasn't explored enough on the client yet, this faction might not yet be known or exist on the client.

Parameters

x The x coordinate of the sector
y The y coordinate of the sector

Returns

The faction index, or nil if the sector's controller is unknown

function var getLocalFaction(int x, int y)

Does a lookup on the faction map and retrieves the faction controlling the given sector by default.

Parameters

x The x coordinate of the sector
y The y coordinate of the sector

Returns

The faction's index, or nil if the sector is in no man's land

function var getNearestFaction(int x, int y)

Does a lookup on the faction map and retrieves the nearest faction to the given sector. Distance is calculated from the factions' home sector. Keep in mind that if the player hasn't explored enough on the client yet, this faction might not yet exist on the client.

Parameters

x The x coordinate of the sector
y The y coordinate of the sector

Returns

The faction index

function UserObject getPlayerCraftFaction()

Getter for the player's current craft's faction. Returns the player if the craft is owned by himself, or the alliance if the player is flying an alliance ship.

Returns

The faction that the player's craft belongs to

function int... getPlayerIndices()

function table<int, string> getPlayerNames()

function bool isCentralFactionArea(int x, int y, var factionIndex)

Returns whether the given sector is in the central part of the faction area of the given faction

Parameters

x The x coordinate of the sector
y The y coordinate of the sector
factionIndex The faction to check or nil to use the nearest faction

Returns

A bool indicating whether the given sector is in the central faction area

function bool jumpRouteUnobstructed(int fromX, int fromY, int toX, int toY)

Checks if the jump between two sectors is unobstructed by rifts

Parameters

fromX The x coordinate of the first sector
fromY The y coordinate of the first sector
toX The x coordinate of the second sector
toY The y coordinate of the second sector

function bool sectorInRift(int x, int y)

Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7